package com.klw.business.controller;

import com.klw.business.domain.QueryDataParam;
import com.klw.business.service.IDataCenterService;
import com.klw.common.core.controller.BaseController;
import com.klw.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 数据中心 Controller
 */

@RestController
@RequestMapping("/data_center")
public class DataCenterController extends BaseController {

    @Autowired
    private IDataCenterService iDataCenterService;

    @PostMapping("/getBaseCardData")
    public AjaxResult getBaseCardData(){
        return AjaxResult.success(iDataCenterService.getBaseCardData());
    }

    @PostMapping("/getTrendData")
    public AjaxResult getTrendData(@RequestBody QueryDataParam param){
        return AjaxResult.success(iDataCenterService.getTrendData(param));
    }

    @PostMapping("/getRadarData")
    public AjaxResult getRadarData(@RequestBody QueryDataParam param){
        return AjaxResult.success(iDataCenterService.getRadarData(param));
    }

    @PostMapping("/getPieData")
    public AjaxResult getPieData(@RequestBody QueryDataParam param){
        return AjaxResult.success(iDataCenterService.getPieData(param));
    }

    @PostMapping("/getBarData")
    public AjaxResult getBarData(@RequestBody QueryDataParam param){
        return AjaxResult.success(iDataCenterService.getBarData(param));
    }
}
